﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace InvestmentIntelligence.DbModel.Models.Mapping
{
    public class AnalyticsIdeaMap : EntityTypeConfiguration<AnalyticsIdea>
    {
        public AnalyticsIdeaMap()
        {
            this.HasKey(i => i.Id);

            this.Property(t => t.Id).HasColumnName("Id");

            //this.HasMany(m => m.Trades)
            //    .WithMany()
            //    .Map(m => m.MapLeftKey("IdeaId").MapRightKey("TradeId").ToTable("IdeaToTrade", "Analytics"));

            this.HasMany(m => m.Securities)
                .WithMany()
                .Map(m => m.MapLeftKey("IdeaId").MapRightKey("SecurityId").ToTable("IdeaToSecurity", "Analytics"));

           // this
           //.HasOptional(u => u.PerformIdea)
           //.WithOptionalPrincipal(c => c.AnalyticsIdea)
           //.Map(p => p.MapKey("Id"));
        }
    }
}
